#pragma once
#ifndef _GLIBCXX_SSTREAM
#	include <sstream>
#endif // _GLIBCXX_SSTREAM
/** \brief Trace layer
 */
#include "GraphLib.h"

class Trace : public std::stringstream
{
private:
	int FontWidth, FontHeight;
	unsigned int CharNumPerLine, LineNumPerPage;
	int BackgroundColor = 0xFF000000;
	char parse_fmt[32];
	int DisplayCount = 0;

	SFC_Rect Field;
	int Font;
	Surface Background = (Surface)0, BufferSurface = (Surface)0;
	std::list<char *> TraceText;
	// bool Transform = false;

	void DrawText(const char * AppendText);
public:
	Trace();
	~Trace();
	void Setk(int x, int y, int w, int h);
	void Show(Surface surface);
};

extern Trace trace;